/**
 * @Author YuanYuan
 * @Date 2022/7/22
 * @Time 14:49
 */
public class TestDemo {
    public static void main(String[] args) {
        BinarySearchTree binarySearchTree = new BinarySearchTree();
        binarySearchTree.insert(4);
        binarySearchTree.insert(2);
        binarySearchTree.insert(3);
        binarySearchTree.insert(7);
        binarySearchTree.insert(1);
        binarySearchTree.insert(8);
        binarySearchTree.insert(5);
        binarySearchTree.inOrder(binarySearchTree.root);
        System.out.println("=======================");
        System.out.println(binarySearchTree.search(7));
        System.out.println("=======================");
        //binarySearchTree.remove(4);
        System.out.println(binarySearchTree.remove(4));
        binarySearchTree.inOrder(binarySearchTree.root);
    }
}
